@echo off
set ipath="%cd%"
IF "%~1"=="" ( set rel=31
) ELSE ( set rel=%1)

set ipath=%ipath:"=%
set debug=Y

set data2res=c:\changeUnits\data2Restore\%rel%\data2

rem restore data2 original:
echo xcopy %data2res% C:\changeUnits\releases\%rel%\data2 /S /C /F /R /Y
xcopy %data2res% C:\changeUnits\releases\%rel%\data2 /S /C /F /R /Y
echo ...
echo ...
echo restore....

rem limpio directorio restore
rd /s /q "%data2res%"
echo ...
echo ...
echo limpiado....

rem linkeo
junc -s C:\resin-3.0.8\conf C:/changeUnits/releases/%rel%/data2/orange/app-config/resin/desa/
junc -s \data2 C:/changeUnits/releases/%rel%/data2/
junc -s \Mercadolibre\jsapi C:/changeUnits/releases/%rel%/data2/orange/images/jsapi
junc -s \Mercadolibre\WEB C:/changeUnits/releases/%rel%/data2/orange/mercadopago/WEB
junc -s \Mercadolibre\WEB-INF C:/changeUnits/releases/%rel%/data2/orange/java/docdir/WEB-INF	
junc -s \Mercadolibre\WEB-INF\classes "%ipath%/classes"
junc -s \Mercadolibre\WEB-INF\lib C:/changeUnits/releases/%rel%/lib
junc -s \Mercadolibre\WEB-INF\src "%ipath%\src"
echo ...
echo ...
echo linkeadado....

rem backup de archivos a pisarse
call deppy.bat bkp %rel%
echo ...
echo ...
echo backup data2....

rem copia de data2 de chu a data2 original
xcopy "%ipath%\data2" C:\changeUnits\releases\%rel%\data2 /S /C /F /R /Y
echo ...
echo ...
echo copia de data2 de chu a original....

rem branch vobjects
call deppy.bat branch %rel%
echo ...
echo ...
echo brancheado....
